<template>
  <div class="access-container">
    <div ref="accessChart" class="access-chart" />
  </div>
</template>

<script>
export default {
  name: 'Access',
  components: {},
  props: {},
  data () {
    return {}
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {
    this.initChart()
  },
  methods: {
    initChart () {
      const chart = this.$echarts.init(this.$refs.accessChart)
      const option = {
        title: {
          text: '访问量趋势',
          textStyle: {
            color: '#333',
            fontSize: 18
          },
          left: '0%',
          top: '3%'
        },
        xAxis: {
          type: 'category',
          data: [
            '1月',
            '2月',
            '3月',
            '4月',
            '5月',
            '6月',
            '7月',
            '8月',
            '9月',
            '10月',
            '11月',
            '12月'
          ],
          show: true
        },
        grid: {
          containLabel: true,
          bottom: '2%',
          left: '3%',
          right: '3%'
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [100, 50, 200, 100, 200, 90, 170, 250, 300, 100, 50, 200],
            type: 'bar'
          }
        ]
      }
      chart.setOption(option)
    }
  }
}
</script>

<style scoped lang="less">
.access-container {
  width: 100%;
  height: 100%;
  .access-chart {
    width: 100%;
    height: 300px;
  }
}
</style>
